{include file="admin/public/header" /}
<form role="form" method="post" action="{:url('ajax/setting/')}" class ="cmzForm">
<style type="text/css">
    .tab-pane{padding-top: 20px;padding: 20px;}
</style>
    <div class="row">
    <div class="col-sm-12">
    <div class="tabs-container">
            <div style="clear:both;height:20px"></div>
            <div class="tab-content">
                <div id="tab-1" class="tab-pane active">
                     <div class="ibox float-e-margins">
                            <div class="row">
                                <div class="col-sm-12 b-r">
                                   <div class="ibox-title">
                                        <a class="label label-primary pull-right tip" id="admin" msg="文章功能">文章功能<i class="fa fa-question"></i></a>
                                        <h5>文章</h5>
                                    </div>
                                    <div class="ibox-content">
                                     

<div class="aw-content-wrap">
    <div class="mod">
        <div class="mod-head">
            <h3>
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#list" data-toggle="tab"><?php e('文章列表'); ?></a></li>
                    <li><a href="#search" data-toggle="tab"><?php e('搜索'); ?></a></li>
                </ul>
            </h3>
        </div>
        <div class="mod-body tab-content">
            <div class="tab-pane active" id="list">
                <?php if ($searchcount) { ?>
                <div class="alert alert-info">找到 {$searchcount} 条符合条件的内容</div>
                <?php } ?>

                <form id="batchs_form" action="admin/ajax/article_manage/" method="post">
                <input type="hidden" id="action" name="action" value="del" />
                <div class="table-responsive">
                <?php if ($list) { ?>
                    <table class="table table-striped">
                        <thead>
                            <tr>
                                <th><input type="checkbox" class="check-all chooseall"></th>
                                <th>id</th>
                                <th><?php e('文章标题'); ?></th>
                                <th><?php e('评论'); ?></th>
                                <th><?php e('浏览'); ?></th>
                                <th><?php e('作者'); ?></th>
                                <th><?php e('发布时间'); ?></th>
                                <th><?php e('操作'); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                        <form action="" class="cmzForm">
                            <?php foreach ($list AS $key => $v) { ?>
                            <tr>
                                <td><input type="checkbox" class="checkbox1" name="id" value="<?php echo $v['id']; ?>"></td>
                                <th>{$v.id}</th>
                                <td><a href="/article/{$v.id}.html" target="_blank"><?php echo $v['title']; ?></a></td>
                                <td><?php echo $v['comments']; ?></td>
                                <td><?php echo $v['views']; ?></td>
                                <td><a href="" target="_blank"><?php echo $v['user_name']; ?></a></td>
                                <td><?php echo date_friendly($v['add_time']); ?></td>
                                <td><a class="btn btn-primary btn-xs" href="{:url('post/publish/article')}?id={$v.id}" target="blank">修改</a></td>
                            </tr>
                            <?php } ?>
                         </form>
                        </tbody>
                    </table>
                    <div class="pull-right">  {$list->render()}</div>
                <?php } ?>
                </div>
                </form>
                <div class="mod-table-foot">
                    <?php echo $this->pagination; ?>
                    <a class="btn btn-danger cmzdelmore" where="id" table="{:encode('article')}"  href="javascript:;"><?php e('删除'); ?></a>
                </div>
            </div>

            <div class="tab-pane" id="search">
                <form method="post" action="{:url('admin/article/list')}" onsubmit="return false;" id="search_form" class="form-horizontal" role="form">

                    <input name="action" type="hidden" value="search" />

                    <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label"><?php e('关键词'); ?>:</label>

                        <div class="col-sm-5 col-xs-8">
                            <input class="form-control" type="text" value="<?php echo rawurldecode($_GET['keyword']); ?>" name="keyword" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label"><?php e('分类'); ?>:</label>

                        <div class="col-sm-5 col-xs-8">
                            <select name="category_id" id="category_id" class="form-control">
                                <option value="0"></option>
                                {volist name="category" id="v"}
                                <option value="{$v.id}">{$v.title}</option>
                                {/volist}
                            </select>
                        </div>
                    </div>

                   <!--  <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label">发起时间范围:</label>

                        <div class="col-sm-6 col-xs-9">
                            <div class="row">
                                <div class="col-xs-11  col-sm-5 mod-double">
                                    <input type="text" class="form-control mod-data" value="" name="start_date" />
                                    <i class="icon icon-date"></i>
                                </div>
                                <span class="mod-symbol col-xs-1 col-sm-1">
                                -
                                </span>
                                <div class="col-xs-11 col-sm-5">
                                    <input type="text" class="form-control mod-data" value="" name="end_date" />
                                    <i class="icon icon-date"></i>
                                </div>
                            </div>
                        </div>
                    </div> -->

                    <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label">作者:</label>

                        <div class="col-sm-5 col-xs-8">
                            <input class="form-control" type="text" value="" name="user_name" />
                        </div>
                    </div>

                   <!--  <div class="form-group">
                        <label class="col-sm-2 col-xs-3 control-label">评论数:</label>

                        <div class="col-sm-6 col-xs-9">
                            <div class="row">
                                <div class="col-xs-11  col-sm-5 mod-double">
                                    <input type="text" class="form-control" name="comment_count_min" value="" />
                                </div>
                                <span class="mod-symbol col-xs-1 col-sm-1">
                                -
                                </span>
                                <div class="col-xs-11 col-sm-5">
                                    <input type="text" class="form-control" name="comment_count_max" value="" />
                                </div>
                            </div>
                        </div>
                    </div> -->

                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-5 col-xs-8">
                            <a type="button"  class="btn btn-primary search">搜索</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('.search').click(function(event) {
        keyword=$("input[name='keyword']").val();
        category_id = $("#category_id option:selected").val(); 
        user_name= $("input[name='user_name']").val();
        // answer_count_min= $("input[name='answer_count_min']").val();
        // answer_count_max= $("input[name='answer_count_max']").val();
        // best_answer= $("input[name='best_answer']").val();
        window.location.href="?keyword="+keyword+"&category_id="+category_id+"&user_name="+user_name
    });
</script>


                                    </div>
                                </div>
                                
                            </div>  
                            <div style="clear:both;height:5px"></div> 
                            <div class="hr-line-dashed"></div>
                               
                             <div style="clear:both;height:5px"></div>    
                    </div>
                </div>
            </div>

        </div>
    </div>
        
           
</div>
<div style="clear:both;"></div>
 <div>
     
  
    </div>


           
   </form>

{include file="admin/public/footer" /}